package com.rising.threads.unsafeContainer;

/**
 * @Author: rising
 * @Description:
 * @Date: create in 2020/12/27 20:55
 */
public class Test1 {
    public static void main(String[] args) {
        A a = new A();
        A b = new B();
        a.sayA();
        B b1 = (B) b;
        b1.sayB();
        b1.sayA();
    }
}

class A {
    public void sayA() {
        System.out.println("A");
    }
}

class B extends A {
    public void sayB() {
        System.out.println("B");
    }
}
